@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/comeAndGo.css?v=1.0.1">
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.select.js"></script>
    <script>
        //供应商
        var suppliers = [
            <?php $j = count($supplier_name_arr);$i = 0; ?>
                    @foreach ($supplier_name_arr as $k )'{{$k}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div style="padding:20px 0;"><h3>供应商管理</h3></div>
        <ul class="supplier-ul">
            {{--供应商管理--}}
            <li id="manage" class="supplier-li">
                <form action="" method="get">
                    <p class="head_sou" style="width:1030px;">
                        <label class="sel_ab" style="width:170px;">供应类型：
                            <select class="pro_s name_lab" name="supply_type" style="width:100px;">
                                @if(empty($requestInfos['supply_type']))
                                <option value="">请选择</option>
                                @else
                                <option value="{{$requestInfos['supply_type']}}">{{$requestInfos['supply_type']}}</option>
                                <option value="">请选择</option>
                                @endif
                                <option value="面料">面料</option>
                                <option value="辅料">辅料</option>
                                <option value="毛皮">毛皮</option>
                                <option value="针织">针织</option>
                                <option value="花边">花边</option>
                                <option value="梭织">梭织</option>
                                <option value="工艺">工艺</option>
                                <option value="罗口">罗口</option>
                                <option value="加工厂">加工厂</option>

                            </select>
                        </label>
                        <label class="sel_ab" style="width:235px;">供应商名称：
                            <input id="nameInput0" class="address name_lab" style="width:140px" type="text" autocomplete="off" autocorrect="off" name="name" placeholder="输入供应商名称" value="{{$requestInfos['name']}}">
                        </label>
                        <label class="sel_ab" style="width:205px">联系人：
                            <input class="address name_lab" style="width:140px" type="text" autocomplete="off" autocorrect="off" name="contact_person" placeholder="输入联系人" value="{{$requestInfos['contact_person']}}">
                        </label>
                        <label class="sel_ab" style="width:205px">手机号：
                            <input class="address name_lab" style="width:140px" type="text" autocomplete="off" autocorrect="off" name="tel" placeholder="输入手机号" value="{{$requestInfos['tel']}}">
                        </label>
                        <a class="btn btn_del btn-info" href="javascript:;" onclick="sweep()">清空</a>
                        <button type="submit" class="btn btn_del btn-info">搜索</button>
                    </p>
                </form>
                <div class="audit-choose">
                    <span>共<span class="in_count info_sum">{{$supplierInfos_count}}</span>条信息</span>
                    <a class="btn bt_a btn-primary" href="/admin/add_come_and_go">添加</a>
                </div>
                <div class="audit_tab">
                    <table class="audit" border="1" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>供应商简称</td><td>供应类型</td><td>供应商名称</td><td>简拼</td>
                            <td style="width:200px;">供应商地址</td><td>联系人</td><td>手机号</td><td>座机号</td><td>合作开始</td><td>银行账号</td><td style="width:200px;">备注</td><td>操作</td>
                        </tr>
                        @foreach($supplierInfos as $k => $v)
                            <tr class="audit_{{$v->id}}">
                                <td>{{$v->alias}}</td>
                                <td>{{$v->supply_type}}</td>
                                <td>{{$v->name}}</td>
                                <td>{{$v->short_name}}</td>
                                <td>{{$v->address}}{{$v->address_detail}}</td>
                                <td>{{$v->contact_person}}</td>
                                <td>{{$v->tel}}</td>
                                <td>{{$v->seat_tel}}</td>
                                <td>
                                    @if($v->cooperation_start =='0000-00-00 00:00:00')
                                    @else
                                        {{str_limit($v->cooperation_start,10,'')}}
                                    @endif
                                </td>
                                <td>{{$v->bank_account}}</td>
                                <td>{{$v->remarks}}</td>
                                <td>
                                    <a href="/admin/add_come_and_go?id={{$v->id}}">修改</a>
                                    <a href="javascript:;" onclick="delMan({{$v->id}})">删除</a>
                                </td>
                            </tr>
                        @endforeach
                        {{--添加结束--}}
                    </table>
                    <span style="float:right;"><div style="float: right;margin:20px 0;"><button class="btn btn-info" onclick="returnPage()" style="float:right;">跳转</button><input type="text" class="form-control returnPage" style="width:6rem;float: right;margin:0 5px;"></div>{{$supplierInfos->appends(['supply_type'=>$requestInfos['supply_type'],'contact_person'=>$requestInfos['contact_person'],'tel'=>$requestInfos['tel'],'name'=>$requestInfos['name']])->links()}}</span>
                </div>
            </li>
        </ul>
    </div>
    <script>
        $.selectSuggest('nameInput0', suppliers);
    </script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/comeAndGo.js?v=1.0.4"></script>
@endsection